From c7a7e550dc4dfb5656ef9d5340eacd9a960a3d7c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 21 Sep 2022 21:51:58 -0400 Subject: [PATCH] Only print supported debug flags It is a bit disorienting to print a lot of unavailable debug flags, with some working ones mixed in. Just show the ones that work. --- gdk/gdk.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gdk/gdk.c b/gdk/gdk.c index 2550c0f294..2c145a0898 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -256,16 +256,12 @@ gdk_parse_debug_var (const char *variable, fprintf (stderr, "Supported %s values:\n", variable); for (i = 0; i < nkeys; i++) { - fprintf (stderr, " %s%*s%s", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help); - if (!debug_enabled && !keys[i].always_enabled) - fprintf (stderr, " [unavailable]"); - fprintf (stderr, "\n"); + if (debug_enabled || keys[i].always_enabled) + fprintf (stderr, " %s%*s%s\n", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help); } fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values"); fprintf (stderr, " %s%*s%s\n", "help", max_width - 4, " ", "Print this help"); fprintf (stderr, "\nMultiple values can be given, separated by : or space.\n"); - if (!debug_enabled) - fprintf (stderr, "Values marked as [unavailable] are only accessible if GTK is built with G_ENABLE_DEBUG.\n"); } if (invert) -- 2.30.2